﻿namespace Alkitab
{
    using Microsoft.Phone.Controls;
    using Microsoft.Phone.Tasks;
    using System;
    using System.IO;
    using System.Windows;

    public partial class About : PhoneApplicationPage
    {
        #region Constructors

        public About()
        {
            InitializeComponent();
            var rstream = Application.GetResourceStream(new Uri("About.txt", UriKind.Relative));
            StreamReader aboutFlow = new StreamReader(rstream.Stream);
            aboutX.Text = "" + aboutFlow.ReadToEnd();
            PageTitle.Text = returnabout;
        }

        #endregion Constructors

        #region Properties

        private string returnabout
        {
            get
            {
                if ((int)Globals.Settingan["languagek?"] == 1)
                {
                    return ("tentang");
                }
                else
                {
                    if ((int)Globals.Settingan["languagek?"] == 2)
                    {
                        return ("about");
                    }

                    else
                    {
                        return ("info");
                    }
                }
            }
        }

        #endregion Properties

        #region Methods

        private void laporBugs_Click(object sender, EventArgs e)
        {
            EmailComposeTask email = new EmailComposeTask();
            email.To = "Rowanto <luo@rowanto.eu>";
            email.Subject = "Bug Alkitab Indonesia";
            email.Body = "Please give a description about the bug here. \n Mohon deskripsikan prilaku bug tersebut di sini.";
            email.Show();
        }

        private void visitBibleDatabase_Click(object sender, EventArgs e)
        {
            WebBrowserTask openbrowser = new WebBrowserTask();
            openbrowser.Uri = new Uri("http://bibledatabase.com/", UriKind.Absolute);
            openbrowser.Show();
        }

        #endregion Methods
    }
}